﻿Imports Cls_Common
Partial Class Control_MSDS_ContentEditorSection
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            If Request.PhysicalPath.Contains("Section01") Then
                lbtSection01.CssClass = "current_manage"
                lbtSection01.Text = "<span class=""current_manage"">Section 1</span>"

            ElseIf Request.PhysicalPath.Contains("Section02") Then
                lbtSection02.CssClass = "current_manage"
                lbtSection02.Text = "<span class=""current_manage"">Section 2</span>"

            ElseIf Request.PhysicalPath.Contains("Section03") Then
                lbtSection03.CssClass = "current_manage"
                lbtSection03.Text = "<span class=""current_manage"">Section 3</span>"

            ElseIf Request.PhysicalPath.Contains("Section04") Then
                lbtSection04.CssClass = "current_manage"
                lbtSection04.Text = "<span class=""current_manage"">Section 4</span>"

            ElseIf Request.PhysicalPath.Contains("Section05") Then
                lbtSection05.CssClass = "current_manage"
                lbtSection05.Text = "<span class=""current_manage"">Section 5</span>"

            ElseIf Request.PhysicalPath.Contains("Section06") Then
                lbtSection06.CssClass = "current_manage"
                lbtSection06.Text = "<span class=""current_manage"">Section 6</span>"

            ElseIf Request.PhysicalPath.Contains("Section07") Then
                lbtSection07.CssClass = "current_manage"
                lbtSection07.Text = "<span class=""current_manage"">Section 7</span>"

            ElseIf Request.PhysicalPath.Contains("Section08") Then
                lbtSection08.CssClass = "current_manage"
                lbtSection08.Text = "<span class=""current_manage"">Section 8</span>"

            ElseIf Request.PhysicalPath.Contains("Section09") Then
                lbtSection09.CssClass = "current_manage"
                lbtSection09.Text = "<span class=""current_manage"">Section 9</span>"

            ElseIf Request.PhysicalPath.Contains("Section10") Then
                lbtSection10.CssClass = "current_manage"
                lbtSection10.Text = "<span class=""current_manage"">Section 10</span>"

            ElseIf Request.PhysicalPath.Contains("Section11") Then
                lbtSection11.CssClass = "current_manage"
                lbtSection11.Text = "<span class=""current_manage"">Section 11</span>"

            ElseIf Request.PhysicalPath.Contains("Section12") Then
                lbtSection12.CssClass = "current_manage"
                lbtSection12.Text = "<span class=""current_manage"">Section 12</span>"

            ElseIf Request.PhysicalPath.Contains("Section13") Then
                lbtSection13.CssClass = "current_manage"
                lbtSection13.Text = "<span class=""current_manage"">Section 13</span>"

            ElseIf Request.PhysicalPath.Contains("Section14") Then
                lbtSection14.CssClass = "current_manage"
                lbtSection14.Text = "<span class=""current_manage"">Section 14</span>"

            ElseIf Request.PhysicalPath.Contains("Section15") Then
                lbtSection15.CssClass = "current_manage"
                lbtSection15.Text = "<span class=""current_manage"">Section 15</span>"

            ElseIf Request.PhysicalPath.Contains("Section16") Then
                lbtSection16.CssClass = "current_manage"
                lbtSection16.Text = "<span class=""current_manage"">Section 16</span>"
            End If
            hidID.Value = Request("Id")
        End If

    End Sub
    Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtSection01.Click, lbtSection02.Click, lbtSection03.Click, lbtSection04.Click,
            lbtSection05.Click, lbtSection06.Click, lbtSection07.Click, lbtSection08.Click, lbtSection09.Click, lbtSection10.Click, lbtSection11.Click, lbtSection12.Click, lbtSection13.Click, lbtSection14.Click, lbtSection15.Click, lbtSection16.Click
        Try
            If Not Session("Username") = "" Then
                Select Case CType(sender, Control).ID
                    Case "lbtSection01"
                        li1.Attributes.Add("class", "current_manage")
                        Response.Redirect("Section01.aspx?Id=" & hidID.Value)
                    Case "lbtSection02"
                        Response.Redirect("Section02.aspx?Id=" & hidID.Value)
                    Case "lbtSection03"
                        Response.Redirect("Section03.aspx?Id=" & hidID.Value)
                    Case "lbtSection04"
                        Response.Redirect("Section04.aspx?Id=" & hidID.Value)
                    Case "lbtSection05"
                        Response.Redirect("Section05.aspx?Id=" & hidID.Value)
                    Case "lbtSection06"
                        Response.Redirect("Section06.aspx?Id=" & hidID.Value)
                    Case "lbtSection07"
                        Response.Redirect("Section07.aspx?Id=" & hidID.Value)
                    Case "lbtSection08"
                        Response.Redirect("Section08.aspx?Id=" & hidID.Value)
                    Case "lbtSection09"
                        Response.Redirect("Section09.aspx?Id=" & hidID.Value)
                    Case "lbtSection10"
                        Response.Redirect("Section10.aspx?Id=" & hidID.Value)
                    Case "lbtSection11"
                        Response.Redirect("Section11.aspx?Id=" & hidID.Value)
                    Case "lbtSection12"
                        Response.Redirect("Section12.aspx?Id=" & hidID.Value)
                    Case "lbtSection13"
                        Response.Redirect("Section13.aspx?Id=" & hidID.Value)
                    Case "lbtSection14"
                        Response.Redirect("Section14.aspx?Id=" & hidID.Value)
                    Case "lbtSection15"
                        Response.Redirect("Section15.aspx?Id=" & hidID.Value)
                    Case "lbtSection16"
                        Response.Redirect("Section16.aspx?Id=" & hidID.Value)
                End Select
            Else
                Response.Redirect("../../Login.aspx")
            End If
        Catch ex As Exception
            Excute_Javascript("AlertboxRedirect('Có lỗi tham chiếu số quyết định.','ThongTinChung.aspx?Id=" & hidID.Value & "');", Me.Page, True)
        End Try


    End Sub

End Class
